package goroutine

import (
	"fmt"
	"sync"
	"time"
)

var onceDoing sync.Once

func onlyone() {
	onceDoing.Do(func() {
		fmt.Println("不想执行第二次!")
	})
	fmt.Println("执行!执行!执行！！！")
}

func DemoOnceDoing() {
	go onlyone()
	go onlyone()
	go onlyone()

	time.Sleep(time.Second)
}
